# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=libdroplet
_pkgname=Droplet
pkgver=2.0
pkgrel=10
pkgdesc="Cloud storage client library"
options="!check" # Tests are in another package
url="https://www.scality.com"
arch="all"
license="MIT"
depends_dev="json-c-dev"
makedepends="$depends_dev autoconf automake libtool libxml2-dev openssl1.1-compat-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/scality/Droplet/archive/v$pkgver.tar.gz
	libdroplet-json-c.patch
	openssl-1.1.patch
	"

builddir="$srcdir"/$_pkgname-$pkgver
prepare() {
	default_prepare
	sed -e "s/json/json-c/g" -i configure.ac
	./autogen.sh
}

build() {
	./configure --prefix=/usr
	make
}

package() {
	make DESTDIR="$pkgdir" install
	rm -rf "$pkgdir"/usr/lib/*.a
}

sha512sums="9c580bcca80148de85d9a27cb584867401f318610badc2d82ca2cdf220678a857220a5186e888f7c81e8b7fbbeabe9c2ca93e114ca8f6d92d667894f09b53ab5  libdroplet-2.0.tar.gz
56468c69f5a4b6005ededced2ea9ff689beb74ff3cd4883289ef62390f8e82a59a946e207fe98baf0eb4bf701737d36cf86f7fcfed37a2bcf5c66ad0198f76ed  libdroplet-json-c.patch
f75f1990c04fee846a32b971134bdb0303c433234ce552974a8c6fe7163f88359e8c8099226c97dced708e9e5f85da960b317b84598695db89819aecb1e10e46  openssl-1.1.patch"
